<template>
  <view class="empty-content">
    <image class="empty-content-image" :src="typeSrc" mode="aspectFit"></image>
    <text>{{ emptyText }}</text>
  </view>
</template>

<script>
export default {
  props: {
    src: {
      type: String,
      default: "empty",
    },
    emptyText: {
      type: String,
      default: "暂无数据",
    },
  },

  data() {
    return {
      typeSrc: require("../../static/images/icon/empty.png"),
    };
  },

  computed: {
    setSrc() {
      return this.typeSrc[this.src];
    },
  },
};
</script>

<style lang="scss">
.empty-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  // z-index: -1;
  z-index: 0;
  > image {
    width: 196rpx;
    height: 196rpx;
  }
  > text {
		margin-top: 19rpx;
    text-align: center;
    font-family: PingFang SC;
    font-weight: 500;
    font-size: 36rpx;
    color: #dcdcdc;
		padding-bottom: 20%;
  }
}
</style>
